#!/bin/sh

# create_crontabs.sh
# wiSync
#
# Created by Youssef Francis on 12/9/07.
# Copyright 2007 iFrancis Development Team. All rights reserved.

if [ "${sync_hour}" != null ]
then
	if [ "${sync_hour}" == 24 ]
	then
	sync_hour=0
	fi
else
sync_hour=0
fi

case $sync_interval in
0 ) echo "0,20,40 * * * * /Applications/Scripts/rsync.sh" >> /Applications/wiSync/Resources/Scripts/wisync.cron;;
1 ) echo "0,30 * * * * /Applications/Scripts/rsync.sh" >> /Applications/wiSync/Resources/Scripts/wisync.cron;;
3 ) echo "0 0,6,12,18 * * * /Applications/Scripts/rsync.sh" > /Applications/wiSync/Resources/Scripts/wisync.cron;;
4 ) echo "0 ${sync_hour} * * * /Applications/Scripts/rsync.sh" > /Applications/wiSync/Resources/Scripts/wisync.cron;;
esac